package info.ask4research.model.activities;

import info.ask4research.model.roles.Role;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@DiscriminatorValue("SupportActivity")
@JsonAutoDetect
public class SupportActivity extends Activity{

	
	@LazyCollection(LazyCollectionOption.FALSE)
	@ManyToMany
    @JoinTable(name="SUPPORTEDROLES",  joinColumns= @JoinColumn(name="role_ID", referencedColumnName="activity_ID"))
	private List<Role> supportedRoles = new ArrayList<Role>();

	public List<Role> getSupportedRoles() {
		return supportedRoles;
	}

	public void setSupportedRoles(List<Role> supportedRoles) {
		this.supportedRoles = supportedRoles;
	}
	
}
